import org.apache.commons.lang3.RandomUtils;
import org.apache.commons.lang3.StringUtils;

import java.text.SimpleDateFormat;
import java.util.Date;

public class test {
    public static void main(String[] args) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd/");

        // 2.调用SimpleDateFormat对象中的方法format
        //String format(Date date) 按照指定的模式，把Date日期，格式化为符合模式的字符串
        Date date = new Date();
        String d = sdf.format(date);

        String path = d + System.currentTimeMillis() + RandomUtils.nextInt(100, 9999) + "." + StringUtils.substringAfterLast("abc.jpg", ".");
        System.out.println(path);
    }
}
